package testClasses.misc;

import galaxies.GalaxySizeCalculator;
import gameAppLayer.GameSettings;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.logging.Level;
import java.util.logging.Logger;

import testClasses.ATest;
import testClasses.TestingSystem;
import utilities.Key;
import controller.AbstractController;

public class GalaxySizeCalculatorTest extends ATest {

	private static final Logger logger = Logger.getLogger(GalaxySizeCalculatorTest.class.getName());
	
	public GalaxySizeCalculatorTest(TestingSystem system) {
		super(system);
		name = "GalaxySizeCalculatorTest";
		logger.log(Level.INFO, "Created");
	}

	@Override
	public boolean execute() {
		
		logger.log(Level.INFO, "execute()");
		
		HashMap<Key, AbstractController> controllerMap = new HashMap<Key, AbstractController>();
		eventManager.addControlMapReference(controllerMap);
		
		TestGameSettingsDefaults defaults = new TestGameSettingsDefaults();
		GameSettings settings = defaults.settings;
		
		GalaxySizeCalculator galSizeCalc = new GalaxySizeCalculator();
		HashMap<String, ArrayList<ArrayList<Integer>>> galSizes = galSizeCalc.calcGalaxyDims(settings);
		
		String galRef = settings.getGalaxyRefs().get(0);
		ArrayList<ArrayList<Integer>> dims = galSizes.get(galRef);
		
		int x, y;
		for (ArrayList<Integer> points: dims) {
			x = points.get(0);
			y = points.get(1);
			System.out.println(x + " " + y);
		}
		
		return false;
	}

}
